arr=(colors(*,360))

;arr_sort_index = SORT(arr)
;original_index = indgen(N_ELEMENTS(arr))
;
;arr_sort       = arr  (arr_sort_index)
;original_index = SORT (arr_sort_index)
;
;uniques= arr_sort(UNIQ(arr_sort))
;uniques_n = N_ELEMENTS(uniques)
;
;colors_uniq = 254*(findgen(uniques_n)/(uniques_n-1))
;
;colors_arr = arr
;  for i=0,uniques_n-1 do colors_arr(where(arr eq uniques(i)))=colors_uniq(i)
;
;print,arr,arr_sort_index,arr_sort,indgen(N_ELEMENTS(arr)),original_index,(arr_sort(original_index)),format='(20I4)'

colors_arr=unique_colorized(arr)

wset,0
plot,arr
oplot,colors_arr


end